/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f7fa;
    line-height: 1.5;
}

/* 主容器 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 左侧边栏 */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 24px;
    color: #3498db;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 15px;
}

.nav-link:hover {
    background-color: #34495e;
    color: #ecf0f1;
    padding-left: 25px;
}

.nav-item.active .nav-link {
    background-color: #3498db;
    color: #ffffff;
    border-left: 4px solid #2980b9;
    padding-left: 16px;
}

.nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    margin-left: 250px;
    flex: 1;
    transition: all 0.3s ease;
}

/* 顶部导航栏 */
.top-navbar {
    background-color: #ffffff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    display: none;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 15px;
    padding-right: 35px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-box i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.notification {
    position: relative;
    font-size: 18px;
    cursor: pointer;
}

.notification .badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* 通用卡片样式 */
.card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.card-body {
    padding: 20px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #666;
}

.btn-outline:hover {
    border-color: #3498db;
    color: #3498db;
}

/* 标签样式 */
.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status.active {
    background-color: #d5f5e3;
    color: #27ae60;
}

.status.pending {
    background-color: #fef9e7;
    color: #f39c12;
}

.status.expired {
    background-color: #fadbd8;
    color: #e74c3c;
}

.status.canceled {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .search-box {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-navbar {
        padding: 15px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .navbar-right {
        gap: 10px;
    }
    
    .user-profile span {
        display: none;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 文本颜色 */
.text-success {
    color: #27ae60;
}

.text-danger {
    color: #e74c3c;
}

.text-warning {
    color: #f39c12;
}

.text-info {
    color: #3498db;
}

/* 操作按钮 */
.action-btn {
    padding: 6px 10px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background-color: #f0f0f0;
}

.action-btn.view {
    color: #3498db;
}

.action-btn.cancel {
    color: #e74c3c;
}

.action-btn.edit {
    color: #27ae60;
}

.action-btn.delete {
    color: #e74c3c;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1000;
    border-radius: 4px;
    overflow: hidden;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #666;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination li {
    list-style: none;
    margin: 0 5px;
}

.pagination li a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination li a:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.pagination li.active a {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 筛选器样式 */
.filter-container {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item label {
    font-weight: 500;
    color: #666;
}

/* 刷新按钮 */
.refresh-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background-color: #f0f0f0;
    color: #3498db;
    transform: rotate(180deg);
}

/* 时间筛选器 */
.time-filter {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.time-filter:hover {
    border-color: #3498db;
    color: #3498db;
}

/* 图表控件 */
.chart-controls {
    display: flex;
    gap: 5px;
}

.control-btn {
    padding: 4px 12px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background-color: #e9ecef;
}

.control-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 系统状态样式 */
.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.system-status i {
    font-size: 12px;
}

/* 网格布局容器 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}